Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROX-27695: Collector runtime configuration should be logged #2012

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JoukoVirtanen
Copy link
Contributor

@JoukoVirtanen JoukoVirtanen commented Jan 17, 2025

Description

It is important for customers to know what the current collector runtime configuration is. While this can be read from the ConfigMap, it is possible that some misconfiguration in the ConfigMap, will cause the actual runtime configuration to be something other than what the user expects. For this reason it is important to log the runtime configuration in collector. Also it may also be important to know the timestamp at which a certain runtime configuration was applied. A ConfigMap will not by itself preserve that history.

In addition to the change mentioned above, a bug is fixed, which made it so that for each test in a group of tests in the same suite, separate collector log files are created. Currently in such cases each test overwrites the log file of the previous test. This change was needed to make the testing of this PR easier.

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing
- [ ] Added unit tests
- [ ] Added integration tests
- [ ] Added regression tests

If any of these don't apply, please comment below.

This is just a change to the logging so no new testing is required.

Testing Performed

Ran

make -C integration-tests TestRuntimeConfigFile

and checked the log files.

The log for TestRuntimeConfigFileDisable had the following

[INFO    2025/01/17 19:06:54] (ConfigLoader.cpp:99) Runtime configuration:
networking {
  external_ips {
  }
  max_connections_per_minute: 2048
}

and

[INFO    2025/01/17 19:06:58] (CollectorConfig.h:150) Resetting runtime configuration
[DEBUG   2025/01/17 19:06:58] (ConfigLoader.cpp:173) Got directory event for "/etc/stackrox/runtime_config.yaml" - mask: [ delete ]
[INFO    2025/01/17 19:06:58] (CollectorConfig.h:150) Resetting runtime configuration

The log for TestRuntimeConfigFileEnable had the following

[INFO    2025/01/17 19:07:15] (ConfigLoader.cpp:99) Runtime configuration:
networking {
  external_ips {
    enabled: ENABLED
  }
  max_connections_per_minute: 2048
}


and

[INFO    2025/01/17 19:07:19] (CollectorConfig.h:150) Resetting runtime configuration
[DEBUG   2025/01/17 19:07:19] (ConfigLoader.cpp:173) Got directory event for "/etc/stackrox/runtime_config.yaml" - mask: [ delete ]
[INFO    2025/01/17 19:07:19] (CollectorConfig.h:150) Resetting runtime configuration

and

[INFO    2025/01/17 19:07:25] (ConfigLoader.cpp:99) Runtime configuration:
networking {
  external_ips {
    enabled: ENABLED
  }
  max_connections_per_minute: 2048
}

The log for TestRuntimeConfigFileInvalid had the following

[ERROR   2025/01/17 19:07:45] (ConfigLoader.cpp:59) Unable to read config from "/etc/stackrox/runtime_config.yaml"

@JoukoVirtanen JoukoVirtanen requested a review from a team as a code owner January 17, 2025 20:00
@JoukoVirtanen JoukoVirtanen changed the title Jv rox 27695 collector runtime configuration should be logged ROX-27695: collector runtime configuration should be logged Jan 18, 2025
@JoukoVirtanen JoukoVirtanen changed the title ROX-27695: collector runtime configuration should be logged ROX-27695: Collector runtime configuration should be logged Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant